/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.wp1.servlets;

import java.io.File;
import java.util.Observable;
import java.util.Observer;


/**
 *
 * @author jio
 *
 * CrawlObserver should only know about the Wp1Api
 * It doesn't need to know which object it is observing
 * It doesn't have a handler or implementation when the object changes
 * These are delegated to the api
 */
public class CrawlObserver  implements Observer {
    private Wp1Api api;

    /**
     * @return the api
     */
    public Wp1Api getApi() {
        return api;
    }

    /**
     * @param api the api to set
     */
    public void setApi(Wp1Api api) {
        this.api = api;
    }
    
      public void update(Observable o, Object arg) {
        if (arg != null && arg instanceof File) {
            File f = (File) arg;
            api.updateServiceClient(f);
        }

}
   


}
